

<template>
  <van-nav-bar title="发送短信" />
 <div>

   <van-cell-group>
 <van-field v-model="data.to" label="电话号码" placeholder="" />
 <van-field v-model="data.content" label="短信内容" placeholder="" />
</van-cell-group>
 
   <van-button type="primary" style=" margin-top: 20px;" @click="doCall">发送短信</van-button>
 </div>
</template>

<script setup lang='ts' name='' >
import { reactive, ref } from "vue";
import { showToast } from 'vant';


// Your script here

let data = reactive({
   to:"13999999999",
   content:'这个是短信内容'
 });


const doCall = ()=>{
 if(!data.to){
   showToast('未填写电话号码');
   return 
 }

 (window as any).whJSBridge.sendSMS(JSON.stringify(data))
 .then((res:any)=>{
   console.log("回调参数",res)
   showToast("回调成功")
 })
   

}



</script>

<style scoped >
/* Your styles here */
</style>